package com.twu.biblioteca.menu;

import com.twu.biblioteca.movies.Movie;
import com.twu.biblioteca.movies.MovieCollection;
import com.twu.biblioteca.users.UserSession;

public class ListOfMoviesOption implements OptionChoosenByUser {
    @Override
    public void execute() {
        if (UserSession.isUserLoggedIn()) {
            MovieCollection movieCollection = MovieCollection.getInstance();
            for (Movie movie : movieCollection.getAll()) {
                System.out.println(movie);
            }
        } else {
            System.out.println("You dont have permission to view available movies");
        }
    }
}
